import type { IFieldProps, IConfigProps } from '@/components/sofastui/AdvancedTable/interface'
import type { FormRule } from '@form-create/element-ui'

export const fields: IFieldProps[] = [
  {
    label: 'ID',
    prop: 'id',
    minWidth: 60,
    import: true,
    export: true,
    search: true,
  },
  {
    label: '厂商名称',
    prop: 'name',
    minWidth: 60,
    import: true,
    export: true,
    search: true,
  },
  {
    label: '短信签名',
    prop: 'signName',
    minWidth: 60,
    import: true,
    export: true,
    search: true,
  },
  {
    label: 'accessKey',
    prop: 'accessKey',
    minWidth: 60,
    import: true,
    export: true,
    search: true,
  },
  {
    label: 'secretKey',
    prop: 'secretKey',
    minWidth: 60,
    import: true,
    export: true,
    search: true,
  },
  {
    label: '描述',
    prop: 'desc',
    minWidth: 60,
    import: true,
    export: true,
    search: true,
  },
  {
    label: '创建时间',
    prop: 'createdAt',
    minWidth: 60,
    import: true,
    export: true,
    search: true,
  },
  {
    label: '修改时间',
    prop: 'updatedAt',
    minWidth: 60,
    import: true,
    export: true,
    search: true,
  },
]

export const config: IConfigProps = {
  name: 'sysSmsFirmTable',
  rowKey: 'id',
  url: '/api/sys/sms_firm',
  selection: true,
  add: true,
  delete: true,
  expand: true,
  showIndex: true,
  import: true,
  export: true,
  search: true,
  advancedSearch: true,
  refresh: true,
  settings: true,
}

export const formRules: FormRule = [
  {
    type: 'input',
    field: 'name',
    title: '厂商名称',
    $required: true,
    props: {
      placeholder: '请输入厂商名称',
    },
    _fc_id: 'id_Fu1lmc22xd9zaic',
    name: 'name',
    display: true,
    hidden: false,
    _fc_drag_tag: 'input',
    col: {
      span: 12,
    },
  },
  {
    type: 'input',
    field: 'signName',
    title: '短信签名',
    $required: true,
    props: {
      placeholder: '请输入短信签名',
    },
    _fc_id: 'id_Fja7mc22xer3alc',
    name: 'signName',
    display: true,
    hidden: false,
    _fc_drag_tag: 'input',
    col: {
      span: 12,
    },
  },
  {
    type: 'input',
    field: 'accessKey',
    title: 'accessKey',
    $required: true,
    props: {
      placeholder: '请输入accessKey',
    },
    _fc_id: 'id_Fja7mc21xer3xlc',
    name: 'accessKey',
    display: true,
    hidden: false,
    _fc_drag_tag: 'input',
    col: {
      span: 12,
    },
  },
  {
    type: 'input',
    field: 'secretKey',
    title: 'secretKey',
    $required: true,
    props: {
      placeholder: '请输入secretKey',
    },
    _fc_id: 'id_Fsa1mc21xe23xlc',
    name: 'secretKey',
    display: true,
    hidden: false,
    _fc_drag_tag: 'input',
    col: {
      span: 12,
    },
  },
  {
    type: 'input',
    field: 'desc',
    title: '备注',
    $required: false,
    props: {
      type: 'textarea',
      placeholder: '请输入备注',
    },
    _fc_id: 'id_Fwn9mc22xutzaoc',
    name: 'desc',
    display: true,
    hidden: false,
    _fc_drag_tag: 'textarea',
    col: {
      span: 24,
    },
  },
]
